home *** CD-ROM | disk | FTP | other *** search
-
- In article <1993Jan31.171831.6931@desire.wright.edu>
- fheitkamp@desire.wright.edu writes:
- >In article <1993Jan30.112215.9215@imada.ou.dk>, breese@monet.imada.ou.dk
- (Bjorn Reese) writes:
- >> Out of pure curiosity, I did some speed tests on different
- >> line drawing routines.
- >>
- >>
- >> WritePixel() looses badly to your own plot routines.
- >
- > How does one go about writing a speedy substitute for WritePixel()?
-
- That's not very hard, but the plot routine which I used in the speed tests
- was too optimized to be used anywhere else.
-
- A more generic (though it must be re-coded if the screen depth is changed),
- yet still fast, routine can be found below the dashed line. It plots to 3
- interleaved bitmaps. If you use normal bitmaps, you must make sure that the
- bitplanes are consecutive. The source is for AsmOne and Devpac.
-
- This plot routine is approx. 4 times faster than WritePixel().
-
- --
-
- Bjorn Reese | Email: breese@imada.ou.dk
- Odense University, Denmark | Voice: +45 65 932 182 (private)
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- ;------------------------------------------------------------------
- ; @Plot3
- ;------------------------------------------------------------------
- ; IN d0.w = x
- ; d1.w = y
- ; d2.w = color
- ; a0.l = ^Screen
- ; USED d0-d1/a1
- ; TIME 158cc
- ; breese@imada.ou.dk(Bjorn Reese)
- ;------------------------------------------------------------------
-
- ;--- For Normal (consecutive) BitMaps
- ;NxtPlane = ScreenWidth*ScreenDepth
- ;NxtMulu = ScreenWidth
-
- ;--- For Interleaved BitMaps
- NxtPlane = ScreenWidth
- NxtMulu = ScreenWidth*ScreenDepth
-
-
- Plot3: lea MuluArray(pc),a1 add.w d1,d1 move.w (a1,d1.w),a1 adda.l a0,a1 ;ScrPtr += y * Width move.w d0,d1 not.b d1 ;Bit Number asr.w #3,d0 adda.w d0,a1 ;ScrPtr += x move.w d2,d0 add.w d0,d0 move.w JumpArray(pc,d0.w),d0 jmp JumpArray(pc,d0.w)
-
- JumpArray: dc.w Col000-JumpArray,Col001-JumpArray dc.w Col010-JumpArray,Col011-JumpArray dc.w Col100-JumpArray,Col101-JumpArray dc.w Col110-JumpArray,Col111-JumpArray
-
- Col000: bclr.b d1,(a1) bclr.b d1,NxtPlane(a1) bclr.b d1,2*NxtPlane(a1) rts
- Col001: bset.b d1,(a1) bclr.b d1,NxtPlane(a1) bclr.b d1,2*NxtPlane(a1) rts
- Col010: bclr.b d1,(a1) bset.b d1,NxtPlane(a1) bclr.b d1,2*NxtPlane(a1) rts
- Col011: bset.b d1,(a1) bset.b d1,NxtPlane(a1) bclr.b d1,2*NxtPlane(a1) rts
- Col100: bclr.b d1,(a1) bclr.b d1,NxtPlane(a1) bset.b d1,2*NxtPlane(a1) rts
- Col101: bset.b d1,(a1) bclr.b d1,NxtPlane(a1) bset.b d1,2*NxtPlane(a1) rts
- Col110: bclr.b d1,(a1) bset.b d1,NxtPlane(a1) bset.b d1,2*NxtPlane(a1) rts
- Col111: bset.b d1,(a1) bset.b d1,NxtPlane(a1) bset.b d1,2*NxtPlane(a1) rts
-
- MuluArray:
- aaa SET 0 REPT ScreenHeight dc.w aaa
- aaa SET aaa+NxtMulu ENDR
-
-
-